import type { VxeGridPropTypes } from 'vxe-table'

export const contractType: any[] = [
	{
		title: '租客合同',
		value: 1
	},
	{
		title: '企业合同',
		value: 2
	}
]

const tenant: VxeGridPropTypes.Columns =
	[
		{
			title: '合同状态',
			width: 120,
			align: 'left',
			fixed: 'left',
			slots: {
				default: 'label'
			}
		},
		{
			minWidth: 400,
			title: '签约类型/成交方式/签约人/签约时间/房源编号/房源地址',
			slots: {
				default: 'contract'
			}
		},
		{
			minWidth: 260,
			title: '姓名/电话/证件类型/证件号码',
			slots: {
				default: 'personal'
			},
		},
		{
			minWidth: 260,
			title: '周期/租金/押金/付款方式',
			slots: {
				default: 'cycle'
			}
		},
		{
			title: '操作',
			align: 'center',
			width: 150,
			fixed: 'right',
			slots: {
				default: 'action'
			}
		}
	]

const enterprise: VxeGridPropTypes.Columns =
	[
		{
			title: '状态',
			width: 120,
			slots: {
				default: 'label'
			}
		},
		{
			minWidth: 150,
			title: '企业名称',
			slots: {
				default: 'enterpriseName'
			}
		},
		{
			minWidth: 300,
			title: '成交方式/签约人/签约时间/包租数量',
			slots: {
				default: 'contract'
			}
		},
		{
			minWidth: 260,
			title: '姓名/电话',
			slots: {
				default: 'personal'
			}
		},
		{
			minWidth: 260,
			title: '周期/租金/押金/付款方式',
			slots: {
				default: 'cycle'
			}
		},
		{
			title: '操作',
			align: 'center',
			width: 150,
			fixed: 'right',
			slots: {
				default: 'action'
			}
		}
	]


/** 获取表头 */
export const getColumns = (type: number): VxeGridPropTypes.Columns => {
	switch (type) {
		case 1:
			return tenant
		case 2:
			return enterprise
		default:
			return []
	}
}
